{% extends "admin/layout.html" %}

{% block content %}
<div class="card">
    <div class="card-header">
        <h4>项目统计概览</h4>
    </div>
    <div class="card-body">
        <div class="row">
            <div class="col-12">
                <div class="card shadow-sm">
                    <div class="card-header">
                        <h5>详细统计</h5>
                    </div>
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-bordered table-hover">
                                <thead class="thead-dark">
                                    <tr>
                                        <th colspan="2" class="text-center">项目统计</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td width="30%">总项目数</td>
                                        <td><strong>{{ stats.projects.total }}</strong></td>
                                    </tr>
                                    <tr>
                                        <td>进行中项目</td>
                                        <td><span class="badge badge-primary">{{ stats.projects.in_progress }}</span></td>
                                    </tr>
                                    <tr>
                                        <td>已完成项目</td>
                                        <td><span class="badge badge-success">{{ stats.projects.completed }}</span></td>
                                    </tr>
                                    <tr>
                                        <td>总任务数</td>
                                        <td><strong>{{ stats.tasks.total }}</strong></td>
                                    </tr>
                                    <tr>
                                        <td>已完成任务</td>
                                        <td><span class="badge badge-success">{{ stats.tasks.completed }}</span></td>
                                    </tr>
                                    <tr>
                                        <td>任务完成率</td>
                                        <td>
                                            <div class="progress">
                                                <div class="progress-bar" role="progressbar"
                                                     style="width: {{ stats.tasks.completion_rate }}%"
                                                     aria-valuenow="{{ stats.tasks.completion_rate }}"
                                                     aria-valuemin="0"
                                                     aria-valuemax="100">
                                                    {{ stats.tasks.completion_rate }}%
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>参与成员数</td>
                                        <td><span class="badge badge-info">{{ stats.members.total }}</span></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}

{% block scripts %}
{% endblock %}